1. Field of the Invention
The present invention relates generally to data processing and, in particular, to a conditional processing method and apparatus for efficient memory management.
2. Description of the Related Art
Description languages can be classified into imperative and declarative description languages. The imperative description languages focus on ‘how to’ obtain a goal so as to explicitly specify an algorithm to achieve the goal. Imperative description languages include Fortran, C, Java, etc.
In contrast, declarative description languages focus on ‘what’ should be done so as to explicitly specify the goal and leave the implementation to the algorithm. When programming with Hyper Text Markup Language (HTML) as a representative declarative description language, what is to be presented by an HTML view, i.e. browser, is declared and thus a procedural algorithm of the browser converts what to be presented to pixels to be displayed on a screen. The representative declarative description languages include Extensible Stylesheet Language Transformations (XSLT), Structured Query Language (SQL), Scalable Vector Graphics (SVG) based on Extensible Markup Language (XML), and Lightweight Application Scene Representation (LASeR).
LASeR is an International standard developed to provide users with enriched content services through free presentation and user interaction using diverse multimedia elements such as scene description, video, audio, image, font, text, metadata, and script, with the development of the communication and broadcast technologies.
Conditional processing is a service control method for determining validity of a result, whether to provide a service or not, and execution time of information through the evaluation on a given expression. In the declarative description language, the conditional processing includes a logical declaration written with a declarative description language determined as a conditional processing function such that the validity of the information, whether to provide the service, and execution time of the information are described determinatively.
FIG. 1 is a flowchart illustrating a procedure of a conditional processing at a UE of received data with a conventional declarative description language.
Referring to FIG. 1, a data stream is received and an elementary stream is allocated to a decoding buffer in step 100. The UE decodes the data stream in step 110. The decoded elementary stream is loaded in a configuration memory in step 120. The elementary stream loaded in the configuration memory, i.e. the data component, is split into meaningful tokens. These tokens are analyzed in hierarchical relationship such that the data is structured as a predetermined parse tree in a sentence structure. All the elements are loaded in the configuration memory so as to be configured for execution. When there is an element executing the conditional processing function among the hierarchical elements of the parse tree in step 130, the UE loads all the child nodes targeted to be evaluated in step 140 and accesses the nodes on a one-by-one basis in step 150. That is, the UE performs conditional processing on all the child nodes on a one-by-one basis at step 150. The UE determines whether the conditional processing evaluate result is true in step 160 and, if it is true, outputs the result to a display.
In such conventional conditional processing, the conditional processing is performed after all the downward nodes (child nodes) are loaded in the configuration memory. When a child node evaluated as ‘true’ appears during the conditional processing, the conditional processing is terminated. The conventional conditional processing is designed such that the child nodes that are not displayed on the screen according to the evaluation result are maintained as loaded on the configuration memory. Accordingly, all the child nodes of a command node for conditional processing are loaded in the configuration memory so as to occupy large memory space. Therefore, even when only one child node is output as the result of the conditional processing, the rest of the child nodes, i.e. the nodes of which conditional processing evaluation result are ‘false’, maintain occupancy in the memory space.
That is, the execution of data structured with the conventional declarative description language is designed such that all decoded data is loaded in the configuration memory to be decomposed into a parse tree, whereby the conditional processing nodes are processed on a one-by-one basis along with other nodes in the same manner.
According to the recent technology trends, there will likely be a network model integrating different technologies such as Digital Video Broadcast-Convergence of Broadcasting and Mobile Service (DVB-CBMS) and Internet Protocol Television (IPTV) so as to integrally serve different types of devices. When a single network operator manages the wired and wireless networks integrally for providing IPTV service, the IPTV service can be provided to both the mobile and fixed devices. For instance, a broadcast service can be implemented such that a broadcast stream is transmitted to support various types of end user terminals different from each other in display size, memory size, capability, and other characteristics. This means that the same service can be provided through different devices including home digital TV and mobile phone. In line with this trend, various technologies for providing terminal-adaptive and situation-adaptive services are being proposed. In such an integrated network-based service environment, the aforementioned conditional processing method is likely to require a large memory space for accommodating the increased number of child nodes to be evaluated, However, terminals having relatively low capability will experience processing overload, resulting in a service failure. In addition to the network integration, the service integration increases the probability for a terminal to simultaneously receive various services, such that large memory occupancy of a specific application makes it difficult for the terminal to efficiently manage its resources for other services.